package wang.Seacher.seven.bean;

import com.geccocrawler.gecco.annotation.Attr;
import com.geccocrawler.gecco.annotation.Gecco;
import com.geccocrawler.gecco.annotation.Href;
import com.geccocrawler.gecco.annotation.HtmlField;
import com.geccocrawler.gecco.annotation.Image;
import com.geccocrawler.gecco.annotation.Request;
import com.geccocrawler.gecco.annotation.RequestParameter;
import com.geccocrawler.gecco.request.HttpRequest;
import com.geccocrawler.gecco.spider.HtmlBean;

import lombok.Data;
import lombok.ToString;

@Data
@ToString // http://www.99mm.me/xinggan/2442.html
@Gecco(matchUrl = "http://www.99mm.me/{topic}/{imgNum}.html", pipelines = { "getPicDetail" })
public class DetailPictureVo implements HtmlBean{

	private static final long serialVersionUID = -2302133289183519674L;

	@Request
	private HttpRequest request;
	
	 /**
     * 图片编号
     */
    @RequestParameter
    private String imgNum;
    
    /**
     * 图片主题
     */
    @RequestParameter
    private String topic;
    
    /**
     * 图片
     */
//    @HtmlField(cssPath="#picbox")
//    private String img;
    
	@HtmlField(cssPath = "dl > dt")
	private String biaoti;

	// 图片说明
	@Href(click=true)
	@HtmlField(cssPath = "dl > dt > a")
	private String herf;
	
	// 图片
	@Image({"data-lazy-img", "src"})
    @HtmlField(cssPath="dl > dt > a > img")
	private String imgUrl;

	@Attr("width")
	@HtmlField(cssPath = "width")
	private String width;
    
    
//	@HtmlField(cssPath = "#picbox > a")
//	private String biaoti;
//
//	// 图片说明
//	@Href(click=true)
//	@HtmlField(cssPath = "#picbox > a")
//	private String herf;
//	
//	// 图片
//	@Image({"data-lazy-img", "src"})
//    @HtmlField(cssPath="a > img")
//	private String imgUrl;
//
//	@Attr("width")
//	@HtmlField(cssPath = "width")
//	private String width;
	
//	
//	public void setBiaoti(String str) {
//		if (!JudgeUtil.isPresent(str)) {
//			return;
//		}
//		int alt = str.indexOf("alt");
//		int one = str.indexOf("\"", alt);
//		int two = str.indexOf("\"", one + 1);
//
//		String substring = str.substring(one + 1, two);
//
//		this.biaoti = substring;
//	}
//
//	public String getBiaoti() {
//		return biaoti;
//	}
//	
//	public PictureVo getPictureVo(){
//		PictureVo pictureVo = new PictureVo();
//		
//		pictureVo.setBiaoti(biaoti);
//		pictureVo.setHerf(herf);
//		pictureVo.setImgUrl(imgUrl);
//		pictureVo.setWidth(width);
//		pictureVo.setTopic(topic);
//		
//		return pictureVo;
//	}
	



}
